//
// Created by antler on 2018/11/12.
//

#ifndef LUA_JNILDEF_H
#define LUA_JNILDEF_H

#define NO_ERROR 0
#define BAD_VALUE -1

#define PACKAGE_NAME "com/antler/luajavalibrary"

#define CLASS_NAME_LUAJAVA PACKAGE_NAME"/luajava/LuaJava"
#define CLASS_NAME_EXCEPTION "java/lang/Exception"

#define METHOD_NAME_PRINT "SM_print"
#define METHOD_SIG_PRINT "(Ljava/lang/String;)V"

// ShellUtils
#define CLASS_NAME_SHELLUTILS PACKAGE_NAME"/utils/ShellUtils"
#define METHOD_NAME_SHELLUTILS_EXECCOMMAND "execCommand"
#define METHOD_SIG_SHELLUTILS_EXECCOMMAND "(Ljava/lang/String;ZZI)Lcom/antler/luajavalibrary/utils/ShellUtils$CommandResult;"

#define FIELD_NAME_COMMANDRESULT_RESULT "result"
#define FIELD_NAME_COMMANDRESULT_SUCCESSMSG "successMsg"
#define FIELD_NAME_COMMANDRESULT_ERRORMSG "errorMsg"

// CommonUtils
#define CLASS_NAME_COMMONUTILS PACKAGE_NAME"/luaext/utils/CommonUtils"
#define METHOD_NAME_COMMONUTILS_ASSETSLOADER "assetsLoader"
#define METHOD_SIG_COMMONUTILS_ASSETSLOADER "(Ljava/lang/String;)[B"

// ImageUtils
#define CLASS_NAME_IMAGEUTILS PACKAGE_NAME"/luaext/utils/ImageUtils"

#define METHOD_NAME_IMAGEUTILS_FROMSCREEN "fromScreen"
#define METHOD_SIG_IMAGEUTILS_FROMSCREEN "(Landroid/graphics/Rect;)Landroid/graphics/Bitmap;"

#define METHOD_NAME_IMAGEUTILS_FROMFILE "fromFile"
#define METHOD_SIG_IMAGEUTILS_FROMFILE "(Ljava/lang/String;)Landroid/graphics/Bitmap;"

#define METHOD_NAME_IMAGEUTILS_SAVETOFILE "saveToFile"
#define METHOD_SIG_IMAGEUTILS_SAVETOFILE "(Landroid/graphics/Bitmap;Ljava/lang/String;I)Z"

#define METHOD_NAME_IMAGEUTILS_ROTATION "rotation"
#define METHOD_SIG_IMAGEUTILS_ROTATION "(Landroid/graphics/Bitmap;F)Landroid/graphics/Bitmap;"

#define METHOD_NAME_IMAGEUTILS_CLIP "clip"
#define METHOD_SIG_IMAGEUTILS_CLIP "(Landroid/graphics/Bitmap;Landroid/graphics/Rect;)Landroid/graphics/Bitmap;"

// RuntimeUtils
#define CLASS_NAME_RUNTIMEUTILS PACKAGE_NAME"/luaext/utils/RuntimeUtils"
#define METHOD_NAME_RUNTIMEUTILS_LAUNCHAPP "launchApp"
#define METHOD_SIG_RUNTIMEUTILS_LAUNCHAPP "(Ljava/lang/String;Ljava/lang/String;)V"

#define METHOD_NAME_RUNTIMEUTILS_INPUTTEXT "inputText"
#define METHOD_SIG_RUNTIMEUTILS_INPUTTEXT "(Ljava/lang/String;)V"

// TouchUtils
#define CLASS_NAME_TOUCHUTILS PACKAGE_NAME"/luaext/utils/TouchUtils"

#define METHOD_NAME_TOUCHUTILS_DOWN "down"
#define METHOD_SIG_TOUCHUTILS_DOWN "(III)V"

#define METHOD_NAME_TOUCHUTILS_MOVE "move"
#define METHOD_SIG_TOUCHUTILS_MOVE "(III)V"

#define METHOD_NAME_TOUCHUTILS_UP "up"
#define METHOD_SIG_TOUCHUTILS_UP "(III)V"

#define METHOD_NAME_TOUCHUTILS_TAP "tap"
#define METHOD_SIG_TOUCHUTILS_TAP "(II)V"

#define METHOD_NAME_TOUCHUTILS_SWIPE "swipe"
#define METHOD_SIG_TOUCHUTILS_SWIPE "(IIIII)V"

#define METHOD_NAME_TOUCHUTILS_PRESS "press"
#define METHOD_SIG_TOUCHUTILS_PRESS "(IZ)V"
#define METHOD_SIG_TOUCHUTILS_PRESS_KEYNAME "(Ljava/lang/String;Z)V"

#define METHOD_NAME_TOUCHUTILS_DOUBLEPRESS "doublePress"
#define METHOD_SIG_TOUCHUTILS_DOUBLEPRESS "(I)V"
#define METHOD_SIG_TOUCHUTILS_DOUBLEPRESS_KEYNAME "(Ljava/lang/String;)V"

// ScreenUtils
#define CLASS_NAME_SCREENUTILS PACKAGE_NAME"/luaext/utils/ScreenUtils"
#define METHOD_NAME_SCREENUTILS_GETSIZE "getSize"
#define METHOD_SIG_SCREENUTILS_GETSIZE "()Landroid/util/Size;"

#define METHOD_NAME_SCREENUTILS_GETDPI "getDPI"
#define METHOD_SIG_SCREENUTILS_GETDPI "()I"

// UI
#define CLASS_NAME_UI PACKAGE_NAME"/luaext/ui/UI"
#define METHOD_NAME_UI_TOAST "toast"
#define METHOD_SIG_UI_TOAST "(Ljava/lang/String;I)V"

// UIContext
#define CLASS_NAME_UICONTEXT PACKAGE_NAME"/luaext/ui/UIContext"
#define METHOD_NAME_UICONTEXT_CREATECONTEXT "createContext"
#define METHOD_SIG_UICONTEXT_CREATECONTEXT "(Ljava/lang/String;Ljava/lang/String;)Lcom/antler/luajavalibrary/luaext/ui/UIContext;"

#define METHOD_NAME_UICONTEXT_CREATEVIEW "createView"
#define METHOD_SIG_UICONTEXT_CREATEVIEW "(Ljava/lang/String;)Lcom/antler/luajavalibrary/luaext/ui/UIView;"

#define METHOD_NAME_UICONTEXT_SHOW "show"
#define METHOD_SIG_UICONTEXT_SHOW "()V"

#define METHOD_NAME_UICONTEXT_CLOSE "close"
#define METHOD_SIG_UICONTEXT_CLOSE "()V"

#define METHOD_NAME_UICONTEXT_GETROOTVIEW "getRootView"
#define METHOD_SIG_UICONTEXT_GETROOTVIEW "()Lcom/antler/luajavalibrary/luaext/ui/UIView;"

#define METHOD_NAME_UICONTEXT_FINDVIEW "findView"
#define METHOD_SIG_UICONTEXT_FINDVIEW "(Ljava/lang/String;)Lcom/antler/luajavalibrary/luaext/ui/UIView;"

// UIView
#define CLASS_NAME_UIVIEW PACKAGE_NAME"/luaext/ui/UIView"

#define METHOD_NAME_UIVIEW_GETID "getID"
#define METHOD_SIG_UIVIEW_GETID "()Ljava/lang/String;"

#define METHOD_NAME_UIVIEW_GETTYPE "getType"
#define METHOD_SIG_UIVIEW_GETTYPE "()I"

#define METHOD_NAME_UIVIEW_SUBVIEWSCOUNT "subviewsCount"
#define METHOD_SIG_UIVIEW_SUBVIEWSCOUNT "()I"

#define METHOD_NAME_UIVIEW_GETSUBVIEW "getSubview"
#define METHOD_SIG_UIVIEW_GETSUBVIEW "(I)Lcom/antler/luajavalibrary/luaext/ui/UIView;"

#define METHOD_NAME_UIVIEW_ADDSUBVIEW "addSubview"
#define METHOD_SIG_UIVIEW_ADDSUBVIEW "(Lcom/antler/luajavalibrary/luaext/ui/UIView;I)V"

#define METHOD_NAME_UIVIEW_REMOVESUBVIEW "removeSubview"
#define METHOD_SIG_UIVIEW_REMOVESUBVIEW "(I)V"

#define METHOD_NAME_UIVIEW_REMOVEFROMPARENT "removeFromParent"
#define METHOD_SIG_UIVIEW_REMOVEFROMPARENT "()V"

#define METHOD_NAME_UIVIEW_SETACTIONCALLBACK "setActionCallback"
#define METHOD_SIG_UIVIEW_SETACTIONCALLBACK "(II)V"

#define METHOD_NAME_UIVIEW_REMOVEALLACTIONCALLBACK "removeAllActionCallback"
#define METHOD_SIG_UIVIEW_REMOVEALLACTIONCALLBACK "()V"

#define METHOD_NAME_UIVIEW_TOJSON "toJson"
#define METHOD_SIG_UIVIEW_TOJSON "()Ljava/lang/String;"

#define METHOD_NAME_UIVIEW_SETATTR "setAttr"
#define METHOD_SIG_UIVIEW_SETATTR "(Ljava/lang/String;)V"

#define METHOD_NAME_UIVIEW_SETSTYLE "setStyle"
#define METHOD_SIG_UIVIEW_SETSTYLE "(Ljava/lang/String;)V"

#define METHOD_NAME_UIVIEW_SETPSEUDOSTYLE "setPseudoStyle"
#define METHOD_SIG_UIVIEW_SETPSEUDOSTYLE "(Ljava/lang/String;Ljava/lang/String;)V"

#endif //LUA_JNILDEF_H
